package com.jerry.alibaba.transaction.service;

import com.jerry.alibaba.transaction.entity.CommonResult;
import com.jerry.alibaba.transaction.entity.Order;
import com.jerry.alibaba.transaction.entity.Storage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "service-storage")
public interface StorageFeignService {

    @PostMapping("/storage/create")
    CommonResult create(Storage storage);

    @GetMapping("/storage/get/{id}")
    CommonResult getById(@PathVariable("id") Long id);

    @GetMapping("/storage/get")
    CommonResult getList();

    @PostMapping("/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);

}
